<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="org.apache.shiro.web.filter.authc.FormAuthenticationFilter"%>
<%@ page import="org.apache.shiro.authc.LockedAccountException "%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>登录</title>

    <link href="${ctx}/static/css/bootstrap.min.css" rel="stylesheet">
    <link href="${ctx}/static/font-awesome/css/font-awesome.css" rel="stylesheet">

    <link href="${ctx}/static/css/animate.css" rel="stylesheet">
    <link href="${ctx}/static/css/style.css" rel="stylesheet">
    <!-- END STYLESHEETS -->
    <link rel="shortcut icon" href="${ctx}/static/img/favicon.ico"/>
</head>

<body class="gray-bg">

    <div class="middle-box text-center loginscreen animated fadeInDown">
        <div>
            <div>

                <h1 class="logo-name">SX</h1>

            </div>
            <h3>欢迎进入 后台运营系统</h3>
            <%
			String error = (String) request.getAttribute(FormAuthenticationFilter.DEFAULT_ERROR_KEY_ATTRIBUTE_NAME);
			if(error != null){
			%>
					<div class="alert alert-error controls input-large">
						<button class="close" data-dismiss="alert">×</button>
			<%
					if(error.contains("DisabledAccountException")){
						out.print("用户已被屏蔽,请登录其他用户.");
					}
					else{
						out.print("登录失败，请重试.");
					}
			%>		
					</div>
			<%
				}
			%>
            <p>专注，优化、效率、协调！农业互联网+战略。大数据分析。实时监控，掌握全局。
                <!--Continually expanded and constantly improved Inspinia Admin Them (IN+)-->
            </p>
            <form id="loginForm" action="${ctx}/login" method="post" class="m-t" role="form" >
                <div class="form-group">
                    <input type="text" class="form-control required" placeholder="账号" id="username" name="username" value="${username}">
                </div>
                <div class="form-group">
                    <input type="password" class="form-control required" placeholder="密码" id="password" name="password">
                </div>
                <button type="submit" class="btn btn-primary block full-width m-b">登 录</button>

                <a href="#"><small>忘记密码?</small></a>
                <p class="text-muted text-center"><small>还没有账号?</small></p>
                <a class="btn btn-sm btn-white btn-block" href="${ctx}/register">创建新的账号</a>
            </form>
            <p class="m-t"> <small>圣贤网络技术有限公司 &copy; 2016</small> </p>
        </div>
    </div>

    <!-- Mainly scripts -->
    <script src="${ctx}/static/js/jquery-2.1.1.js"></script>
    <script src="${ctx}/static/js/bootstrap.min.js"></script>

</body>

</html>
